package com.bookstore.services.Impl;

import com.bookstore.bean.User;
import com.bookstore.mappers.UserMapper;
import com.bookstore.services.UserService;
import com.bookstore.utils.DruidUtils;
import org.apache.ibatis.session.SqlSession;

public class UserServiceImpl implements UserService {
    SqlSession sqlSession = DruidUtils.getSqlSession();
    UserMapper mapper = sqlSession.getMapper(UserMapper.class);
    @Override
    public User login(User user) {
        return mapper.loginUser(user);
    }

    @Override
    public boolean register(User user) {
        return mapper.insertUser(user)>0;
    }
}
